<template>
    <view class="zxPage bg-fff">
        <view class="topBox col-fff">
            <view class="fontBold tit">个人征信报告查询流程</view>
        </view>
        <view class="listBox bg-fff">
            <block v-for="(item,index) in 7" :key="index">
                <view class="itemBox">
                    <image class="itemImg" :lazy-load="true" :src="'https://image.srea.org.cn/xcx/baogao/baogao-'+(index+1)+'.jpg'" mode="widthFix"></image>
                </view>
            </block>
        </view>
        <share-btn :display="scrollAnimate"></share-btn>
    </view>
</template>

<script>
    import { mapState, mapActions } from 'pinia';
    import { useConfigStore, useUserInfoStore } from '@/store/index';
    // import { dispatchClient } from '@/common/api-adviser';
    import { isBoolean } from '@/common/common';
    export default {
        data() {
            return {
                scrollAnimate: false,
                list: [{
                    image: 'https://image.srea.org.cn/xcx/baogao/baogao-1.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/baogao-2.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/baogao-3.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/baogao-4.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/baogao-5.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/baogao-6.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/baogao-7.jpg'
                }],
                productId: '',
                title: '',
                share: false,
                start_time: 0
            }
        },
        computed:{
            ...mapState(useUserInfoStore, ['userInfo'])
        },
        onShareAppMessage(res) {
            return {
                title: `个人征信报告查询流程，点击了解详情`,
                path: `/pages/tools/zheng-xin/bao-gao?productId=${this.productId}&title=${this.title}&puid=${this.userInfo.id}&share=true&prepage=征信报告-${this.productId}-${this.title}`,
            }
        },
        onLoad(options) {
            const that = this;
            let { productId='', title='', puid='', share=false } = options;
            this.productId = productId&&productId!=='undefined'?productId:'';
            this.share = isBoolean(share);
            if(title&&title!=='undefined') {
                this.title = title;
            }
            this.start_time = (new Date()).getTime();
            if(puid&&puid!=='undefined') {
                this.setPuid(puid)
            }
            uni.$check_and_login(function () {
                //绑定客户
                // dispatchClient({
                //     share: that.share,
                //     puid: puid,
                //     pid: that.productId
                // });
            })
        },
        
        onPageScroll() {
            const that = this;
            that.scrollAnimate = true;
            this.$u.debounce(function() {
                that.scrollAnimate = false;
            }, 500);
        },
        methods: {
            ...mapActions(useConfigStore, ['setPuid'])
        }
    }
</script>

<style lang="scss" scoped>
    .zxPage{
        min-height: 100vh;
        overflow: hidden;
        line-height: 1;
        .listBox{
            border-radius: 20rpx;
            overflow: hidden;
            .itemBox{
                margin-top: 40rpx;
                .itemImg{
                    width: 100%;
                }
            }
        }
    }
</style>
